<!DOCTYPE html>
<!--********************************************-->
<!--*       Generated from PreTeXt source      *-->
<!--*                                          *-->
<!--*         https://pretextbook.org          *-->
<!--*                                          *-->
<!--********************************************-->
<html lang="en-US">
<head xmlns:og="http://ogp.me/ns#" xmlns:book="https://ogp.me/ns/book#">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Non-homogeneous Equations and Method of Undetermined Coefficients</title>
<meta name="Keywords" content="Authored in PreTeXt">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:type" content="book">
<meta property="book:title" content="MATH 2023: Ordinary and Partial Differential Equations">
<meta property="book:author" content="Xiaoyi Chen and Wei Zhang">
<script src="https://sagecell.sagemath.org/static/embedded_sagecell.js"></script><script>window.MathJax = {
  tex: {
    inlineMath: [['\\(','\\)']],
    tags: "none",
    tagSide: "right",
    tagIndent: ".8em",
    packages: {'[+]': ['base', 'extpfeil', 'ams', 'amscd', 'newcommand', 'knowl']}
  },
  options: {
    ignoreHtmlClass: "tex2jax_ignore|ignore-math",
    processHtmlClass: "process-math",
    renderActions: {
        findScript: [10, function (doc) {
            document.querySelectorAll('script[type^="math/tex"]').forEach(function(node) {
                var display = !!node.type.match(/; *mode=display/);
                var math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
                var text = document.createTextNode('');
                node.parentNode.replaceChild(text, node);
                math.start = {node: text, delim: '', n: 0};
                math.end = {node: text, delim: '', n: 0};
                doc.math.push(math);
            });
        }, '']
    },
  },
  chtml: {
    scale: 0.88,
    mtextInheritFont: true
  },
  loader: {
    load: ['input/asciimath', '[tex]/extpfeil', '[tex]/amscd', '[tex]/newcommand', '[pretext]/mathjaxknowl3.js'],
    paths: {pretext: "https://pretextbook.org/js/lib"},
  },
startup: {
    pageReady() {
      return MathJax.startup.defaultPageReady().then(function () {
      console.log("in ready function");
      $(document).trigger("runestone:mathjax-ready");
      }
    )}
},
};
</script><script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script><script src="https://pretextbook.org/js/lib/jquery.min.js"></script><script src="https://pretextbook.org/js/lib/jquery.sticky.js"></script><script src="https://pretextbook.org/js/lib/jquery.espy.min.js"></script><script src="https://pretextbook.org/js/0.13/pretext.js"></script><script>miniversion=0.674</script><script src="https://pretextbook.org/js/0.13/pretext_add_on.js?x=1"></script><script src="https://pretextbook.org/js/lib/knowl.js"></script><!--knowl.js code controls Sage Cells within knowls--><script>sagecellEvalName='Evaluate (Sage)';
</script><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,600italic" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Inconsolata:400,700&amp;subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link href="https://pretextbook.org/css/0.4/pretext.css" rel="stylesheet" type="text/css">
<link href="https://pretextbook.org/css/0.4/pretext_add_on.css" rel="stylesheet" type="text/css">
<link href="https://pretextbook.org/css/0.4/banner_default.css" rel="stylesheet" type="text/css">
<link href="https://pretextbook.org/css/0.4/toc_default.css" rel="stylesheet" type="text/css">
<link href="https://pretextbook.org/css/0.4/knowls_default.css" rel="stylesheet" type="text/css">
<link href="https://pretextbook.org/css/0.4/style_default.css" rel="stylesheet" type="text/css">
<link href="https://pretextbook.org/css/0.4/colors_blue_red.css" rel="stylesheet" type="text/css">
<link href="https://pretextbook.org/css/0.4/setcolors.css" rel="stylesheet" type="text/css">
</head>
<body class="pretext-book ignore-math has-toc has-sidebar-left">
<a class="assistive" href="#content">Skip to main content</a><div id="latex-macros" class="hidden-content process-math" style="display:none"><span class="process-math">\(\newcommand{\N}{\mathbb N}
\newcommand{\Z}{\mathbb Z}
\newcommand{\Q}{\mathbb Q}
\newcommand{\R}{\mathbb R}
\newcommand{\lt}{&lt;}
\newcommand{\gt}{&gt;}
\newcommand{\amp}{&amp;}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle     \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle        \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle      \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)</span></div>
<header id="masthead" class="smallbuttons"><div class="banner"><div class="container">
<a id="logo-link" href=""></a><div class="title-container">
<h1 class="heading"><a href="MATH-2023-OPDE.html"><span class="title">MATH 2023: Ordinary and Partial Differential Equations</span></a></h1>
<p class="byline">Xiaoyi Chen and Wei Zhang</p>
</div>
</div></div>
<nav id="primary-navbar" class="navbar"><div class="container">
<div class="navbar-top-buttons">
<button class="sidebar-left-toggle-button button active" aria-label="Show or hide table of contents sidebar">Contents</button><div class="tree-nav toolbar toolbar-divisor-3">
<a class="index-button toolbar-item button" href="index-1.html" title="Index">Index</a><span class="threebuttons"><a id="previousbutton" class="previous-button toolbar-item button" href="sec3_5.html" title="Previous">Prev</a><a id="upbutton" class="up-button button toolbar-item" href="ch_third.html" title="Up">Up</a><a id="nextbutton" class="next-button button toolbar-item" href="sec3_7.html" title="Next">Next</a></span>
</div>
</div>
<div class="navbar-bottom-buttons toolbar toolbar-divisor-4">
<button class="sidebar-left-toggle-button button toolbar-item active">Contents</button><a class="previous-button toolbar-item button" href="sec3_5.html" title="Previous">Prev</a><a class="up-button button toolbar-item" href="ch_third.html" title="Up">Up</a><a class="next-button button toolbar-item" href="sec3_7.html" title="Next">Next</a>
</div>
</div></nav></header><div class="page">
<div id="sidebar-left" class="sidebar" role="navigation"><div class="sidebar-content">
<nav id="toc"><ul>
<li class="link frontmatter"><a href="meta_frontmatter.html" data-scroll="meta_frontmatter" class="internal"><span class="title">Front Matter</span></a></li>
<li class="link">
<a href="ch_first.html" data-scroll="ch_first" class="internal"><span class="codenumber">1</span> <span class="title">Introduction</span></a><ul>
<li><a href="sec_1-intro.html" data-scroll="sec_1-intro" class="internal">Classification of Differential Equations</a></li>
<li><a href="sec_2-intro.html" data-scroll="sec_2-intro" class="internal">Linear and Nonlinear Equation</a></li>
<li><a href="sec_3-intro.html" data-scroll="sec_3-intro" class="internal">Geometrical Aspect</a></li>
<li><a href="sec_4-intro.html" data-scroll="sec_4-intro" class="internal">Motivation</a></li>
</ul>
</li>
<li class="link">
<a href="ch_second.html" data-scroll="ch_second" class="internal"><span class="codenumber">2</span> <span class="title">First Order Ordinary Differential Equations</span></a><ul>
<li><a href="sec2_1.html" data-scroll="sec2_1" class="internal">Linear Equations</a></li>
<li><a href="sec2_2.html" data-scroll="sec2_2" class="internal">Further Discussion of Linear Equations (For reading only)</a></li>
<li><a href="sec2_3.html" data-scroll="sec2_3" class="internal">Separable Equations</a></li>
<li><a href="sec2_4.html" data-scroll="sec2_4" class="internal">Difference Between Linear and Nonlinear Equations</a></li>
<li><a href="sec2_5.html" data-scroll="sec2_5" class="internal">Applications of modeling with first order ODE(For reading only)</a></li>
<li><a href="sec2_6.html" data-scroll="sec2_6" class="internal">Exact Equations and Integrating Factors</a></li>
</ul>
</li>
<li class="link">
<a href="ch_third.html" data-scroll="ch_third" class="internal"><span class="codenumber">3</span> <span class="title">third Order Linear Equations</span></a><ul>
<li><a href="sec3_1.html" data-scroll="sec3_1" class="internal">Homogeneous equations with constant coefficient</a></li>
<li><a href="sec3_2.html" data-scroll="sec3_2" class="internal">Fundamental Solutions of Linear Homogeneous Equations</a></li>
<li><a href="sec3_3.html" data-scroll="sec3_3" class="internal">Linear Independence and Wronskian</a></li>
<li><a href="sec3_4.html" data-scroll="sec3_4" class="internal">Complex roots of the characteristic equations</a></li>
<li><a href="sec3_5.html" data-scroll="sec3_5" class="internal">Repeated Roots: Reduction of Order</a></li>
<li><a href="sec3_6.html" data-scroll="sec3_6" class="active">Non-homogeneous Equations and Method of Undetermined Coefficients</a></li>
<li><a href="sec3_7.html" data-scroll="sec3_7" class="internal">Variation of Parameters</a></li>
</ul>
</li>
<li class="link">
<a href="ch_four.html" data-scroll="ch_four" class="internal"><span class="codenumber">4</span> <span class="title">Higher Order Linear Equations</span></a><ul>
<li><a href="sec4_1.html" data-scroll="sec4_1" class="internal">General Theory of the <span class="process-math">\(n\)</span>-th Order Linear Equations</a></li>
<li><a href="sec4_2.html" data-scroll="sec4_2" class="internal">Homogeneous Equations with Constant Coefficients</a></li>
<li><a href="sec4_3.html" data-scroll="sec4_3" class="internal">The Method of Undetermined Coefficients</a></li>
<li><a href="sec4_4.html" data-scroll="sec4_4" class="internal">The Method of Variation of Parameters</a></li>
</ul>
</li>
<li class="link">
<a href="ch_five.html" data-scroll="ch_five" class="internal"><span class="codenumber">5</span> <span class="title">Series Solutions of Second Order Linear Equations</span></a><ul>
<li><a href="sec5_1.html" data-scroll="sec5_1" class="internal">Brief Review on Power Series</a></li>
<li><a href="sec5_2.html" data-scroll="sec5_2" class="internal">Introduction</a></li>
<li><a href="sec5_3.html" data-scroll="sec5_3" class="internal">Series Solutions Near an Ordinary Point</a></li>
<li><a href="sec5_4.html" data-scroll="sec5_4" class="internal">Euler’s Equation</a></li>
<li><a href="sec5_5.html" data-scroll="sec5_5" class="internal">Series Solution near a Regular Singular Point</a></li>
</ul>
</li>
<li class="link">
<a href="ch_six.html" data-scroll="ch_six" class="internal"><span class="codenumber">6</span> <span class="title">System of First Order Linear Equations</span></a><ul>
<li><a href="sec6_1.html" data-scroll="sec6_1" class="internal">Introduction <span class="process-math">\(\&amp;\)</span> Basic Theory</a></li>
<li><a href="sec6_2.html" data-scroll="sec6_2" class="internal">Homogeneous System with Constant Coefficients</a></li>
<li><a href="sec6_3.html" data-scroll="sec6_3" class="internal">Complex Eigenvalues</a></li>
<li><a href="sec6_4.html" data-scroll="sec6_4" class="internal">Repeated Eigenvalues</a></li>
<li><a href="sec6_5.html" data-scroll="sec6_5" class="internal">Fundamental Matrices</a></li>
<li><a href="sec6_6.html" data-scroll="sec6_6" class="internal">Non-homogeneous linear systems</a></li>
</ul>
</li>
<li class="link">
<a href="ch_seven.html" data-scroll="ch_seven" class="internal"><span class="codenumber">7</span> <span class="title">Partial Differential Equations</span></a><ul>
<li><a href="sec7_1.html" data-scroll="sec7_1" class="internal">Two-Point Boundary Value Problems</a></li>
<li><a href="sec7_2.html" data-scroll="sec7_2" class="internal">Eigenvalue Problems</a></li>
<li><a href="sec7_3.html" data-scroll="sec7_3" class="internal">Fourier Series</a></li>
<li><a href="sec7_4.html" data-scroll="sec7_4" class="internal">The Fourier Convergence Theorem</a></li>
<li><a href="sec7_5.html" data-scroll="sec7_5" class="internal">Even and Odd Functions</a></li>
<li><a href="sec7_6.html" data-scroll="sec7_6" class="internal">Introduction to Partial Differential Equations</a></li>
<li><a href="sec7_7.html" data-scroll="sec7_7" class="internal">1D Heat Equation; Solutions by Separation of Variable and Fourier Series</a></li>
<li><a href="sec7_8.html" data-scroll="sec7_8" class="internal">Other Heat Conduction Problems</a></li>
</ul>
</li>
<li class="link">
<a href="ch_eight.html" data-scroll="ch_eight" class="internal"><span class="codenumber">8</span> <span class="title">Laplace transform</span></a><ul>
<li><a href="sec8_1.html" data-scroll="sec8_1" class="internal">What are Laplace Transforms, and Why?</a></li>
<li><a href="sec8_2.html" data-scroll="sec8_2" class="internal">Finding Laplace Transforms</a></li>
<li><a href="sec8_3.html" data-scroll="sec8_3" class="internal">Finding inverse transforms using partial fractions</a></li>
<li><a href="sec8_4.html" data-scroll="sec8_4" class="internal">Solving ODEs and ODE Systems</a></li>
<li><a href="sec8_5.html" data-scroll="sec8_5" class="internal">Step input and Impulse problems</a></li>
<li><a href="sec8_6.html" data-scroll="sec8_6" class="internal">Laplace transform for PDE (heat equation)</a></li>
</ul>
</li>
<li class="link">
<a href="ch_features.html" data-scroll="ch_features" class="internal"><span class="codenumber">9</span> <span class="title">Examples of PreTeXt features</span></a><ul><li><a href="sec_features-blocks.html" data-scroll="sec_features-blocks" class="internal">Environments and Blocks</a></li></ul>
</li>
<li class="link backmatter"><a href="meta_backmatter.html" data-scroll="meta_backmatter" class="internal"><span class="title">Backmatter</span></a></li>
<li class="link"><a href="solutions-1.html" data-scroll="solutions-1" class="internal"><span class="codenumber">A</span> <span class="title">Selected Hints</span></a></li>
<li class="link"><a href="solutions-2.html" data-scroll="solutions-2" class="internal"><span class="codenumber">B</span> <span class="title">Selected Solutions</span></a></li>
<li class="link"><a href="appendix-1.html" data-scroll="appendix-1" class="internal"><span class="codenumber">C</span> <span class="title">List of Symbols</span></a></li>
<li class="link"><a href="index-1.html" data-scroll="index-1" class="internal"><span class="title">Index</span></a></li>
<li class="link"><a href="colophon-1.html" data-scroll="colophon-1" class="internal"><span class="title">Colophon</span></a></li>
</ul></nav><div class="extras"><nav><a class="pretext-link" href="https://pretextbook.org">Authored in PreTeXt</a><a href="https://www.mathjax.org"><img title="Powered by MathJax" src="https://www.mathjax.org/badge/badge.gif" alt="Powered by MathJax"></a></nav></div>
</div></div>
<main class="main"><div id="content" class="pretext-content"><section class="section" id="sec3_6"><h2 class="heading hide-type">
<span class="type">Section</span> <span class="codenumber">3.6</span> <span class="title">Non-homogeneous Equations and Method of Undetermined Coefficients</span>
</h2>
<p id="p-113">Consider</p>
<div class="displaymath process-math" data-contains-math-knowls="" id="eq3_11">
\begin{equation}
y^{\prime \prime}+p(x) y^{\prime}+q(x) y=g(x),\tag{3.6.1}
\end{equation}
</div>
<p class="continuation">and corresponding homogeneous equation</p>
<div class="displaymath process-math" data-contains-math-knowls="" id="eq3_12">
\begin{equation}
y^{\prime \prime}+p(x) y^{\prime}+q(x) y=0.\tag{3.6.2}
\end{equation}
</div>
<p id="p-114"><dfn class="terminology">Theorem</dfn> If <span class="process-math">\(Y_1(x)\)</span> and <span class="process-math">\(Y_2(x)\)</span> are two solutions of (<a href="" class="xref" data-knowl="./knowl/eq3_11.html" title="Equation 3.6.1">(3.6.1)</a>), then <span class="process-math">\(Y_2(x)-Y_1(x)\)</span> is a solution of (<a href="" class="xref" data-knowl="./knowl/eq3_12.html" title="Equation 3.6.2">(3.6.2)</a>).</p>
<p id="p-115"><dfn class="terminology">Proof:</dfn> Substituting <span class="process-math">\(Y_1\)</span> and <span class="process-math">\(Y_2\)</span> into (<a href="" class="xref" data-knowl="./knowl/eq3_11.html" title="Equation 3.6.1">(3.6.1)</a>), one has</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_11.html ./knowl/eq3_12.html" id="eq3_13">
\begin{equation}
\begin{aligned}
&amp;Y_1^{\prime \prime}+p(x) Y_1^{\prime}+q(x) Y_1=g(x),\\
&amp;Y_2^{\prime \prime}+p(x) Y_2^{\prime}+q(x) Y_2=g(x).
\end{aligned}\tag{3.6.3}
\end{equation}
</div>
<p class="continuation">Then <span class="process-math">\((\ref{eq3_13})_2-(\ref{eq3_13})_1\)</span> gives:</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_11.html ./knowl/eq3_12.html">
\begin{equation*}
(Y_2-Y_1)^{\prime \prime}+p(x) (Y_2-Y_1)^{\prime}+q(x)(Y_2-Y_1)=0,
\end{equation*}
</div>
<p class="continuation">which implies <span class="process-math">\(Y_2-Y_1\)</span> satisfies (<a href="" class="xref" data-knowl="./knowl/eq3_12.html" title="Equation 3.6.2">(3.6.2)</a>).</p>
<p id="p-116"><dfn class="terminology">Theorem</dfn> If <span class="process-math">\(Y(x)\)</span> is a particular solution of (<a href="" class="xref" data-knowl="./knowl/eq3_11.html" title="Equation 3.6.1">(3.6.1)</a>) and <span class="process-math">\(y_1(x)\)</span> and <span class="process-math">\(y_2(x)\)</span> are a set of fundamental solutions to (<a href="" class="xref" data-knowl="./knowl/eq3_12.html" title="Equation 3.6.2">(3.6.2)</a>), then the general solution to (<a href="" class="xref" data-knowl="./knowl/eq3_11.html" title="Equation 3.6.1">(3.6.1)</a>) is given by</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_11.html ./knowl/eq3_12.html ./knowl/eq3_11.html" id="eq3_14">
\begin{equation}
y=C_1 y_1(x)+C_2 y_2(x)+Y(x), \quad C_1, C_2 ~\textrm{are arbitrary constants}.\tag{3.6.4}
\end{equation}
</div>
<p id="p-117"><dfn class="terminology">Proof:</dfn> We need to show that any solution of (<a href="" class="xref" data-knowl="./knowl/eq3_11.html" title="Equation 3.6.1">(3.6.1)</a>) is included in (<a href="" class="xref" data-knowl="./knowl/eq3_14.html" title="Equation 3.6.4">(3.6.4)</a>). Consider any solution <span class="process-math">\(Y_1(x)\text{,}\)</span> we know <span class="process-math">\(Y_1(x)-Y(x)\)</span> is a solution of (<a href="" class="xref" data-knowl="./knowl/eq3_12.html" title="Equation 3.6.2">(3.6.2)</a>). As <span class="process-math">\(C_1 y_1+C_2 y_2\)</span> is the general solution of (<a href="" class="xref" data-knowl="./knowl/eq3_12.html" title="Equation 3.6.2">(3.6.2)</a>), there exist constants <span class="process-math">\(c_1\)</span> and <span class="process-math">\(c_2\)</span> such that</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_11.html ./knowl/eq3_14.html ./knowl/eq3_12.html ./knowl/eq3_12.html ./knowl/eq3_14.html">
\begin{equation*}
Y_1(x)-Y(x)=c_1 y_1+c_2 y_2 \to Y_1(x)=c_1 y_1+c_2 y_2+Y(x),
\end{equation*}
</div>
<p class="continuation">which indicates <span class="process-math">\(Y_1(x)\)</span> is included in (<a href="" class="xref" data-knowl="./knowl/eq3_14.html" title="Equation 3.6.4">(3.6.4)</a>).</p>
<p id="p-118"><dfn class="terminology">Method of Undetermined Coefficients</dfn>This method is used to find the particular solution. The procedure is as follows:(i) Assume a form of solution with some coefficients;(ii) Determine those coefficients.Usually, this method is for the cases that the non-homogeneous term is exponential-, sine-, cosine-functions or polynomials and further the homogeneous ODE is the one with constant coefficients.</p>
<p id="p-119"><dfn class="terminology">Example 1</dfn> Find the general solution of the ODE</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
y^{\prime \prime}-2 y^{\prime}-3 y=3 e^{2 x}.
\end{equation*}
</div>
<p id="p-120"><dfn class="terminology">Solution:</dfn> The general solution of the homogeneous equation:</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
y^{\prime \prime}-2 y^{\prime}-3 y=0 \to r^2-2r-3=0 \to r_1=-1, r_2=3 \to y=C_1 e^{-x}+C_2 e^{3x}.
\end{equation*}
</div>
<p class="continuation">Assume a solution of the form</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=A e^{2x}, \quad A~ \textrm{is to be determined.}
\end{equation*}
</div>
<p class="continuation">Substituting the solution into the ODE, one has</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
4 A e^{2 x}-2\cdot 2 A e^{2x}-3 A e^{2 x}=3 e^{2 x} \to -3 A=3 \to A=-1.
\end{equation*}
</div>
<p class="continuation">Thus, one particular solution is</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=- e^{2 x}
\end{equation*}
</div>
<p class="continuation">And the general solution is</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
y=C_1 e^{-x}+C_2 e^{3 x}-e^{2 x}.
\end{equation*}
</div>
<p id="p-121"><dfn class="terminology">Example 2</dfn> Find a particular solution of the ODE</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
y^{\prime \prime}-2 y^{\prime}-3 y=2 \sin x.
\end{equation*}
</div>
<p id="p-122"><dfn class="terminology">Solution:</dfn> Assume a solution of the form</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=A \sin x.
\end{equation*}
</div>
<p class="continuation">Substituting it into the ODE, one has</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
-A \sin x-2 A \cos x-3 A \sin x=2 \sin x \to -4 A \sin x-2 A \cos x=2 \sin x \to \textrm{can not be satisfied.}
\end{equation*}
</div>
<p class="continuation">Instead, we assume</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=A \sin x+B \cos x.
\end{equation*}
</div>
<p class="continuation">Substituting it into the ODE, one has</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
\begin{aligned}
&amp;-A \sin x-B \cos x-2 (A \cos x-B \sin x)- 3 A \sin x-3 B \cos x= 2 \sin x\\
&amp;\to (-4 A+2 B) \sin x+(-4 B-2 A) \cos x=2 \sin x\\
&amp; \to -4A+2B=2, \quad -4B-2A=0 \\
&amp;\to A=-\frac{2}{5}, \quad B=\frac{1}{5}.
\end{aligned}
\end{equation*}
</div>
<p class="continuation">Thus, the particular solution is</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=-\frac{2}{5} \sin x+\frac{1}{5} \cos x.
\end{equation*}
</div>
<p id="p-123"><dfn class="terminology">Example 3</dfn> Find a particular solution of the ODE</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
y^{\prime \prime}-2 y^{\prime}-3 y=2 x^2.
\end{equation*}
</div>
<p id="p-124"><dfn class="terminology">Solution:</dfn> Assume a solution of the form</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=A x^2+B x+C.
\end{equation*}
</div>
<p class="continuation">Substituting it into the ODE, one has</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
\begin{aligned}
&amp;2 A-2 (2 A x+ B)-3 (A x^2 + B x+ C)= 2 x^2 \\
&amp;\to -3 A x^2+(-4 A-3 B)x+2 A-2 B- 3C=2 x^2\\
&amp;\to -3 A=2, \quad -4A-3B=0, \quad 2 A-2 B- 3 C=0\\
&amp;\to A=-\frac{2}{3}, \quad B=\frac{8}{9}, \quad C=-\frac{28}{27}.
\end{aligned}
\end{equation*}
</div>
<p class="continuation">Then the particular solution is</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=-\frac{2}{3} x^2+\frac{8}{9} x-\frac{28}{27}.
\end{equation*}
</div>
<p id="p-125"><dfn class="terminology">Example 4</dfn> Find a particular solution to the ODE</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
y^{\prime \prime}-2 y^{\prime}-3 y= 2 e^ x \sin x.
\end{equation*}
</div>
<p id="p-126"><dfn class="terminology">Solution:</dfn> Assume the solution in the form</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=e^x (A \sin x+B \cos x).
\end{equation*}
</div>
<p class="continuation">Substituting it into the ODE, one has</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
\begin{aligned}
&amp;2 e^x (A \cos x-B \sin x)-2 e^x \left[(A-B) \sin x+ (A+B) \cos x \right]-3 e^x (A \sin x+B \cos x)=2 e^x \sin x\\
&amp; \to -5 e^x A \sin x-5 e^x B \cos x=2 e^x \sin x\\
&amp;\to -5A=2, \quad -5 B=0\\
&amp;\to A=-\frac{2}{5}, \quad B=0.
\end{aligned}
\end{equation*}
</div>
<p class="continuation">Thus, the particular solution is</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=-\frac{2}{5} e^x \sin x.
\end{equation*}
</div>
<p id="p-127"><dfn class="terminology">Example 5</dfn> Find a particular solution of the ODE</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
y^{\prime \prime}-2 y^{\prime}-3 y=3 e^{2 x}+2 \sin x+ 2x^2+2 e^x \sin x.
\end{equation*}
</div>
<p id="p-128"><dfn class="terminology">Solution:</dfn> Considering the ODE in this form</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_15.html" id="eq3_15">
\begin{equation}
y^{\prime \prime}+p(x) y^{\prime}+q(x) y=g_1(x)+g_2(x).\tag{3.6.5}
\end{equation}
</div>
<p class="continuation">If <span class="process-math">\(y_1\)</span> is a solution of</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_15.html">
\begin{equation*}
y^{\prime \prime}+p(x) y^{\prime}+q(x) y=g_1(x),
\end{equation*}
</div>
<p class="continuation">and <span class="process-math">\(y_2\)</span> is a solution of</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_15.html">
\begin{equation*}
y^{\prime \prime}+p(x) y^{\prime}+q(x) y=g_2(x),
\end{equation*}
</div>
<p class="continuation">then <span class="process-math">\(y_1+y_2\)</span> is a solution of (<a href="" class="xref" data-knowl="./knowl/eq3_15.html" title="Equation 3.6.5">(3.6.5)</a>). For the current problem, we know</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_15.html">
\begin{equation*}
\begin{aligned}
&amp;y^{\prime \prime}-2 y^{\prime}-3 y=3 e^{2 x} \quad \textrm{solution is} ~y_1=-e^{2 x},\\
&amp;y^{\prime \prime}-2 y^{\prime}-3 y=2 \sin x \quad  \textrm{solution is}~y_2=-\frac{2}{5} \sin x+\frac{1}{5} \cos x,\\
&amp;y^{\prime \prime}-2 y^{\prime}-3 y=2 x^2 \quad  \textrm{solution is}~y_3=-\frac{2}{3}x^2+\frac{8}{9}x-\frac{28}{27},\\
&amp;y^{\prime \prime}-2 y^{\prime}-3 y=2 e^x \sin x \quad  \textrm{solution is}~y_4=-\frac{2}{5} e^x \sin x.\\
\end{aligned}
\end{equation*}
</div>
<p class="continuation">Thus, the solution for our problem is (note the superposition)</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_15.html">
\begin{equation*}
y=y_1+y_2+y_3+y_4=-e^{2 x}-\frac{2}{5} \sin x+\frac{1}{5} \cos x-\frac{2}{3}x^2+\frac{8}{9}x-\frac{28}{27}-\frac{2}{5} e^x \sin x.
\end{equation*}
</div>
<p id="p-129"><dfn class="terminology">Example 6</dfn> Find a particular solution of</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
y^{\prime \prime}-y^{\prime}-2 y=e^{2 x}.
\end{equation*}
</div>
<p id="p-130"><dfn class="terminology">Solution:</dfn> Assume the solution in the form</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=A e^{2 x}.
\end{equation*}
</div>
<p class="continuation">Substituting it into the ODE, one has</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
4 A e^{2 x}-2 A e^{2 x}-2 A e^{2 x}=e^{2 x} \to (4 A-2 A-2 A) e^{2 x}=e^{2 x}
\end{equation*}
</div>
<p class="continuation">The equation can never be satisfied which means the assumed form is wrong! The reason is that <span class="process-math">\(e^{2 x}\)</span> is a solution of the corresponding homogeneous equation. Assume that</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=A x e^{2 x}.
\end{equation*}
</div>
<p class="continuation">Substituting it into the ODE, one has</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
\begin{aligned}
&amp;4 A e^{2 x}+4 A x e^{2 x}-A(e^{2 x}+ 2 x e^{2 x})-2 A x e^{2 x}=e^{2 x}\\
&amp;\to (4A-2A-2A) x e^{2 x}+(4 A-A) e^{2 x}=e^{2 x}\\
&amp;\to 3 A=1 \to A=\frac{1}{3}.
\end{aligned}
\end{equation*}
</div>
<p class="continuation">Thus the particular solution is</p>
<div class="displaymath process-math" data-contains-math-knowls="">
\begin{equation*}
Y=\frac{1}{3} x e^{2 x}.
\end{equation*}
</div>
<p id="p-131"><dfn class="terminology">Proof of the Method of Undetermined Coefficients</dfn>(i) Consider</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html" id="eq3_17">
\begin{equation}
y^{\prime \prime}+b y^{\prime}+c y=P_n(x)=a_0 x^n+a_1 x^{n-1}+\cdots+a_{n-1} x+a_n.\tag{3.6.6}
\end{equation}
</div>
<p class="continuation">Assume that</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html" id="eq3_18">
\begin{equation}
Y=A_0 x^n+A_1 x^{n-1}+\cdots+A_{n-1} x+A_n.\tag{3.6.7}
\end{equation}
</div>
<p class="continuation">Substituting it into the ODE, one has</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html" id="eq3_16">
\begin{equation}
\begin{aligned}
&amp;n (n-1) A_0 x^{n-2}+(n-1) (n-2) A_1 x^{n-3}+\cdots+2 A_{n-2}\\
&amp;\quad  \quad +b(n A_0 x^{n-1}+(n-1)A_1 x^{n-2}+\cdots+A_{n-1})\\
&amp;\quad  \quad  \quad+ c(A_0 x^n+A_1 x^{n-1}\cdots+A_{n-1} x+A_n)\\
&amp;\quad  \quad  \quad  \quad=a_0 x^n+a_1 x^{n-1}+\cdots+a_{n-1} x+a_n.
\end{aligned}\tag{3.6.8}
\end{equation}
</div>
<p class="continuation">After arrangement of the two sides, we have</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html">
\begin{equation*}
\begin{cases}
c A_0=a_0\\
c A_1+ n b A_0=a_1\\
\cdots\\
c A_{n-1}+2 b A_{n-2} +6 A_{n-3}=a_{n-1}\\
c A_n+ b A_{n-1}+2 A_{n-2}=a_n
\end{cases}
\end{equation*}
</div>
<p class="continuation"><dfn class="terminology">If</dfn> <span class="process-math">\(c \neq 0\text{,}\)</span> <span class="process-math">\(A_0, A_1, \cdots, A_n\)</span> can be determined and this method works.<dfn class="terminology">If</dfn> <span class="process-math">\(c=0\)</span> but <span class="process-math">\(b \neq 0\text{,}\)</span> then the left hand side of (<a href="" class="xref" data-knowl="./knowl/eq3_16.html" title="Equation 3.6.8">(3.6.8)</a>) is a polynomial of degree <span class="process-math">\(n-1\text{,}\)</span> while the right hand side is always a polynomial of degree <span class="process-math">\(n\text{.}\)</span> Thus (<a href="" class="xref" data-knowl="./knowl/eq3_16.html" title="Equation 3.6.8">(3.6.8)</a>) can never be satisfied. To make the left hand side of (<a href="" class="xref" data-knowl="./knowl/eq3_16.html" title="Equation 3.6.8">(3.6.8)</a>) to have degree <span class="process-math">\(n\text{,}\)</span> we have to assume that</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html" id="eq3_19">
\begin{equation}
Y=x (A_0 x ^n+A_1 x^{n-1}+\cdots+A_{n-1} x+A_n).\tag{3.6.9}
\end{equation}
</div>
<p class="continuation"><dfn class="terminology">If</dfn> both <span class="process-math">\(b=0\)</span> and <span class="process-math">\(c=0\text{,}\)</span> then the left hand side of (<a href="" class="xref" data-knowl="./knowl/eq3_16.html" title="Equation 3.6.8">(3.6.8)</a>) has degree <span class="process-math">\(n-2\text{.}\)</span> Thus, we have to assume</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html ./knowl/eq3_16.html" id="eq3_20">
\begin{equation}
Y=x^2 (A_0 x ^n+A_1 x^{n-1}+\cdots+A_{n-1} x+A_n).\tag{3.6.10}
\end{equation}
</div>
<p id="p-132">(ii) Consider</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_17.html ./knowl/eq3_18.html ./knowl/eq3_21.html ./knowl/eq3_19.html ./knowl/eq3_20.html" id="eq3_21">
\begin{equation}
y^{\prime \prime}+b y^{\prime}+c y=e^{\alpha x} P_n(x).\tag{3.6.11}
\end{equation}
</div>
<p class="continuation">Introduce</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_17.html ./knowl/eq3_18.html ./knowl/eq3_21.html ./knowl/eq3_19.html ./knowl/eq3_20.html">
\begin{equation*}
y=u(x) e^{\alpha x}.
\end{equation*}
</div>
<p class="continuation">Substituting it into the ODE, one has</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_17.html ./knowl/eq3_18.html ./knowl/eq3_21.html ./knowl/eq3_19.html ./knowl/eq3_20.html">
\begin{equation*}
\begin{aligned}
&amp;\alpha^2 e^{\alpha x} u+ 2 \alpha u^{\prime} e^{\alpha x}+u^{\prime \prime} e^{\alpha x}+b (u^{\prime} +\alpha u )e^{\alpha x}+c u e^{\alpha x}=e^{\alpha x} P_n(x)\\
&amp;\to u^{\prime \prime}+(2 \alpha+b)u^{\prime}+(\alpha^2+b \alpha+c) u=P_n(x).
\end{aligned}
\end{equation*}
</div>
<p class="continuation">It is the form of (<a href="" class="xref" data-knowl="./knowl/eq3_17.html" title="Equation 3.6.6">(3.6.6)</a>) in part (i).<dfn class="terminology">If</dfn> <span class="process-math">\(\alpha^2+b \alpha+c \neq 0\text{,}\)</span> we can assume that the solution <span class="process-math">\(u\)</span> have the form (<a href="" class="xref" data-knowl="./knowl/eq3_18.html" title="Equation 3.6.7">(3.6.7)</a>). In other words, we can assume the particular solution to (<a href="" class="xref" data-knowl="./knowl/eq3_21.html" title="Equation 3.6.11">(3.6.11)</a>) is</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_17.html ./knowl/eq3_18.html ./knowl/eq3_21.html ./knowl/eq3_19.html ./knowl/eq3_20.html">
\begin{equation*}
Y=e^{\alpha x} (A_0 x^n+a_1 x^{n-1}+\cdots+A_{n-1}x+A_n).
\end{equation*}
</div>
<p class="continuation"><dfn class="terminology">If</dfn> <span class="process-math">\(\alpha^2+b \alpha+c=0\)</span> and <span class="process-math">\(2 \alpha+b \neq 0\text{,}\)</span> ( i.e., <span class="process-math">\(\alpha\)</span> is a root (not repeated root) of the characteristic equation <span class="process-math">\(r^2+b r+c=0\)</span>), then <span class="process-math">\(u\)</span> has the form (<a href="" class="xref" data-knowl="./knowl/eq3_19.html" title="Equation 3.6.9">(3.6.9)</a>). In other words, we can assume</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_17.html ./knowl/eq3_18.html ./knowl/eq3_21.html ./knowl/eq3_19.html ./knowl/eq3_20.html">
\begin{equation*}
Y=x e^{\alpha x} (A_0 x^n+a_1 x^{n-1}+\cdots+A_{n-1}x+A_n).
\end{equation*}
</div>
<p class="continuation"><dfn class="terminology">If</dfn> both <span class="process-math">\(\alpha^2+b \alpha+c=0\)</span> and <span class="process-math">\(2 \alpha+b=0\)</span> which implies</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_17.html ./knowl/eq3_18.html ./knowl/eq3_21.html ./knowl/eq3_19.html ./knowl/eq3_20.html">
\begin{equation*}
\begin{aligned}
&amp;\alpha=-\frac{b}{2}, \quad \left(-\frac{b}{2}\right)^2+b \left(-\frac{b}{2}\right)+c=0, \\
&amp;\to -\frac{b^2}{4}+c=0,\\
&amp;\to b^2-4 c=0.
\end{aligned}
\end{equation*}
</div>
<p class="continuation">Therefore, <span class="process-math">\(\alpha=-\frac{b}{2}\)</span> is a repeated root of <span class="process-math">\(r^2+b r+c=0\text{.}\)</span> Then <span class="process-math">\(u\)</span> should have the form (<a href="" class="xref" data-knowl="./knowl/eq3_20.html" title="Equation 3.6.10">(3.6.10)</a>). In other words,</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_17.html ./knowl/eq3_18.html ./knowl/eq3_21.html ./knowl/eq3_19.html ./knowl/eq3_20.html">
\begin{equation*}
Y=x^2 e^{\alpha x} (A_0 x^n+a_1 x^{n-1}+\cdots+A_{n-1}x+A_n).
\end{equation*}
</div>
<p id="p-133">(iii) Consider</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_23.html" id="eq3_23">
\begin{equation}
y^{\prime \prime}+b y^{\prime}+c y=e^{\alpha x} \cos \beta x ~P_n(x) \quad  (\textrm{discussions are similar for the case}~ e^{\alpha x} \sin \beta x~P_n(x) ).\tag{3.6.12}
\end{equation}
</div>
<p class="continuation">We note that</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_23.html">
\begin{equation*}
e^{i \beta x}=\cos \beta x+i \sin \beta x, \quad e^{-i \beta x}=\cos \beta x-i \sin \beta x \to \cos \beta x=\frac{e^{i \beta x}+e^{-i \beta x}}{2}.
\end{equation*}
</div>
<p class="continuation">Then</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_23.html" id="eq3_22">
\begin{equation}
\begin{aligned}
&amp;y^{\prime \prime}+b y^{\prime}+c y=\frac{1}{2} e^{(\alpha+ i \beta) x} P_n(x) +\frac{1}{2} e^{(\alpha- i \beta) x} P_n(x) \quad (\textrm{can be decomposed into two parts})\\
&amp; \to y^{\prime \prime}+b y^{\prime}+c y=\frac{1}{2} e^{(\alpha+ i \beta) x} P_n(x)\\
&amp;\quad y^{\prime \prime}+b y^{\prime}+c y=\frac{1}{2} e^{(\alpha- i \beta) x} P_n(x) 
\end{aligned}\tag{3.6.13}
\end{equation}
</div>
<p class="continuation"><span class="process-math">\((\ref{eq3_22})_2\)</span> and <span class="process-math">\((\ref{eq3_22})_3\)</span> degenerate to case (ii).The discussions are as follows.<dfn class="terminology">If</dfn> <span class="process-math">\(\alpha+i \beta\)</span> is not a root of <span class="process-math">\(r^2+b r+c=0\text{,}\)</span> then correspondingly, <span class="process-math">\(\alpha-i \beta\)</span> is not a root to this equation neither. In this case, for <span class="process-math">\((\ref{eq3_22})_2\text{,}\)</span> the particular solution is given as</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_23.html">
\begin{equation*}
y_1=e^{(\alpha+i \beta) x} (A_0 x^n+A_1 x^{n-1}+\cdots+A_{n-1} x+A_n),
\end{equation*}
</div>
<p class="continuation">and for <span class="process-math">\((\ref{eq3_22})_3\text{,}\)</span> the particular solution is given as</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_23.html">
\begin{equation*}
y_2=e^{(\alpha-i \beta) x} (B_0 x^n+B_1 x^{n-1}+\cdots+B_{n-1} x+B_n),
\end{equation*}
</div>
<p class="continuation">Then the particular solution to (<a href="" class="xref" data-knowl="./knowl/eq3_23.html" title="Equation 3.6.12">(3.6.12)</a>) is given as</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_23.html">
\begin{equation*}
\begin{aligned}
y=&amp;y_1+y_2\\
=&amp;\left[ A_0 e^{(\alpha+i \beta) x}+B_0 e^{(\alpha-i \beta) x}\right] x^n+\left[A_1e^{(\alpha+i \beta) x} +B_1 e^{(\alpha-i \beta) x}  \right] x^{n-1}+\cdots +\left[ A_n e^{(\alpha+i \beta) x}+B_n e^{(\alpha-i \beta) x}\right].
\end{aligned}
\end{equation*}
</div>
<p class="continuation">We may write</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_23.html">
\begin{equation*}
\begin{aligned}
A_k e^{(\alpha+i \beta) x}+B_k e^{(\alpha-i \beta) x}&amp;= e^{\alpha x} \left[ (A_k+B_k) \cos \beta x+i (A_k-B_k) \sin \beta x \right]\\
&amp;=e^{\alpha x} \left[ C_k \cos \beta x+ D_k \sin \beta x  \right],
\end{aligned}
\end{equation*}
</div>
<p class="continuation">where <span class="process-math">\(C_k=A_k+B_k\)</span> and <span class="process-math">\(D_k=i (A_k-B_k)\text{.}\)</span>Then the particular solution is rewritten as</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_23.html">
\begin{equation*}
\begin{aligned}
y&amp;=e^{\alpha x} \left[ C_0 \cos \beta x+ D_0 \sin \beta x  \right] x^n+e^{\alpha x} \left[ C_1 \cos \beta x+ D_1 \sin \beta x  \right] x^{n-1}+\cdots+e^{\alpha x} \left[ C_n \cos \beta x+ D_n \sin \beta x  \right]\\
&amp;=e^{\alpha x} \cos \beta x \left[C_0 x^n+C_1 x^{n-1}+\cdots+C_n     \right]+e^{\alpha x} \sin \beta x \left[D_0 x^n+D_1 x^{n-1}+\cdots+D_n     \right].
\end{aligned}
\end{equation*}
</div>
<p class="continuation"><dfn class="terminology">If</dfn> <span class="process-math">\(\alpha + i\beta\)</span> is a root to <span class="process-math">\(r^2+b r+c=0\text{,}\)</span> then so is <span class="process-math">\(\alpha-i\beta\text{.}\)</span> In this case, we can get the particular solution is the form</p>
<div class="displaymath process-math" data-contains-math-knowls="./knowl/eq3_23.html">
\begin{equation*}
y=e^{\alpha x} (\cos \beta x)~x \left[C_0 x^n+C_1 x^{n-1}+\cdots+C_n     \right]+e^{\alpha x} (\sin \beta x) ~x \left[D_0 x^n+D_1 x^{n-1}+\cdots+D_n     \right]
\end{equation*}
</div></section></div></main>
</div>
</body>
</html>
